package com.dmlll.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpSession;
import java.util.Enumeration;

/**
 * 页面路由
 */
@Controller
public class SystemController {
    /**
     * 跳转到就业信息
     * @return
     */
    @RequestMapping("/toEmploymentInformation")
    public String toEmploymentInformation(){
        return "employmentInformation";
    }

    /**
     * 跳转到个人信息
     * @return
     */
    @RequestMapping("/toPersonalInformation")
    public String toPersonalInformation(@RequestParam(value = "id",required = false)Integer id){

        return "personalInformation";
    }

    /**
     * 跳转到配偶信息
     * @return
     */
    @RequestMapping("/toSpouse")
    public String toSpouse(){
        return "/resources/配偶信息";
    }
    /**
     * 跳转到居住信息
     * @return
     */
    @RequestMapping("/toDwellMessage")
    public String toDwellMessage(){
        return "/resources/juzhuxinxi";
    }
    /**
     * 跳转到成员信息
     * @return
     */
    @RequestMapping("/toFamilyMember")
    public String toFamilyMember(){
        return "/resources/Family";
    }
    /**
     * 跳转到计生信息
     * @return
     */
    @RequestMapping("/toFamilyPlanning")
    public String toFamilyPlanning(){
        return "/resources/计生信息";
    }
    @RequestMapping("/toDengLu")
    public String toDegLu(){
        return "resources/denglu";
    }

    /**
     * 跳转到登记信息审核
     * @return
     */
    @RequestMapping("/toPersonalMessageCheck")
    public String toPersonalMessageCheck(){
        return "personalMessageCheck";
    }
    /**
     * 跳转到个人信息查看详情
     * @return
     */
    @RequestMapping("/toPersonalMessageShow")
    public String toPersonalMessageShow(){
        return "personalMessageShow";
    }
    /**
     * 跳转到注册信息审核
     * @return
     */
    @RequestMapping("/toRegisterCheck")
    public String toRegisterCheck(){
        return "resources/zhucexinxishenhe";
    }
    /**
     * 跳转到账户管理
     * @return
     */
    @RequestMapping("/toAccountManager")
    public String toAccountManager(){
        return "resources/zhgl";
    }

    @RequestMapping("/toMainLeft")
    public String toMainLeft(){
        return "mainLeft";
    }
    @RequestMapping("/toMain")
    public String toMain(){
        return "main";
    }
    /**
     * 主页内容
     * @return
     */
    @RequestMapping("toMoFang")
    public String toMoFang(){
        return "index-2";
    }

    /**
     * 查看审核进度
     * @return
     */
    @RequestMapping("toPersonalMessageCheckShow")
    public String toPersonalMessageCheckShow(){
        return "personalMessageCheckShow";
    }
    /**
     * 流动人口信息管理
     * @return
     */
    @RequestMapping("toInformation")
    public String toInformation(){
        return "resources/information1";
    }

    /**
     * 查看流动人口信息详情
     * @return
     */
    @RequestMapping("/toPopulationParticulars")
    public String toPopulationParticulars(){
        return "resources/populationParticulars";
    }
    /**
     * 统计
     */
    @RequestMapping("/toPersonCalculate")
    public String toPersonCalculate(){
        return "personCalculate";
    }
    /**
     * 退出
     */
    @RequestMapping("/toLogout")
    public String toLogout(HttpSession session){
        Enumeration<String> names = session.getAttributeNames();
        while (names.hasMoreElements()){
            session.removeAttribute(names.nextElement().toString());
        }
        return "resources/denglu";
    }
}
